package com.zqweb.gulimall.cart.config;

import com.zqweb.gulimall.cart.interceptor.Cart_UserCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
// 配置WebMvc的相关内容
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    // 添加1个拦截器，注入到容器中
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Cart_UserCheckInterceptor()).addPathPatterns("/**");
    }
}
